//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//     Filename: MHVPXMLTranslator.h                                        //
//  Create date: 6/12/06		                                            //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//  Description: This file describes the MHVPXMLTranslator class.  This     //
//				  class is a protocol translator that translates from the	//
//                RTG Video Poker protocol to XML and back.                 //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//       Copyright (c) 2006 - Realtime Gaming.  All rights reserved.        //
//////////////////////////////////////////////////////////////////////////////

#ifndef __MHVP_XML_TRANSLATOR__
#define __MHVP_XML_TRANSLATOR__

#include "XMLTranslator.h"

//////////////////////////////////////////////////////////////////////////////
// MHVPXMLTranslator Class
//////////////////////////////////////////////////////////////////////////////
class MHVPXMLTranslator : public XMLTranslator
{
public:
    MHVPXMLTranslator( Server* pServer, Connection* pParent );
    virtual ~MHVPXMLTranslator();

    // Public Interface
    virtual bool8  TranslateIncomingMessage( uint8* pGameInBuff,  uint32 nGameInBuffSize, uint8* pBuff, uint32 nOutBuffSize );
    virtual uint32 TranslateOutgoingMessage( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize, uint32 nTotalGameBytes );
    virtual uint8 GetNumBytesRecvMsgLen() const { return 2; }    // kharmon.  12-12-06.  For some games (MHVP) the send and receive msg length bytes are different.

public:
	// Defines
	enum { MAX_CARDS = 5 };

protected:
	// Internal Helpers
	bool8 AddCards( XMLDoc* pDoc, uint8* pBuff, uint32& nOffset, const String& sParentNode );
    bool8 AddPayTableInfo( XMLDoc* pDoc, uint8 nPayTable );
	bool8 AddMultiHands( XMLDoc* pDoc, uint8* pBuff, uint32& nOffset, const String& sParentNode, uint8 nNumHands );
	bool8 AddLoginNumHands( XMLDoc* pDoc, uint8* pBuff, uint32& nOffset );

	// Incoming
	bool8 TranslateInLogin     ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInReload	   ( XMLDoc* pDoc, uint8* pGameInBuff, uint32 nGameInBuffSize ); // CSN-13423: reload with new denom
	bool8 TranslateInDeal      ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInHold      ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDoubleDeny( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDoubleDeal( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDoubleDraw( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );

	// Outgoing
	bool8 TranslateOutLogin  ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize, bool isReload = false );
	bool8 TranslateOutDeal   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutSubGame( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutHold   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutOptions( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

    bool8 TranslateOutDoubleDeny( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
    bool8 TranslateOutDoubleDeal( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
    bool8 TranslateOutDoubleDraw( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

    bool8 TranslateOutError   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

protected:
	uint8 m_nNumHands;

};

#endif //#ifndef __MHVP_XML_TRANSLATOR__
